package com.learning.sims.status;

import android.util.Log;

import com.learning.sims.people.People;
import com.learning.sims.utils.SimsUtil;

/**
 * Created by xie on 2017/4/22.
 */

public class MiningStatus implements IStatus {

    private int mineCount = 5;
    private double minePrice = 0.5;

    @Override
    public void doSomething(long time, People people) {

        if(SimsUtil.isSleepTime(time)){
            people.setStatus(Status.GotoSleep);
            return;
        }

        if(people.isNeedAddEnergy()){
            people.setStatus(Status.GotoEat);
        }else{
            people.setEnergy(people.getEnergy() - people.getMiningSpendEnergyRate());
            people.setMoney(people.getMoney() + mineCount * minePrice);
            Log.d("Sims","Mininging = "+people.getEnergy()+" "+people.getMoney());
        }

    }

}
